package plugin;

import java.util.HashMap;

public class PlatformOptions {
	private String name_registry;
	private boolean docked;
	private boolean selectedONE;
	private boolean selectedTWO;
	private boolean selectedTHREE;
	private int mode;
	protected boolean tempDataOnly;
	private HashMap<String, Integer> links_liste;
	private HashMap<String, Integer> mitte_liste;
	private HashMap<String, Integer> rechts_liste;
	private HashMap<String, Boolean> links_visibles;
	private HashMap<String, Boolean> mitte_visibles;
	private HashMap<String, Boolean> rechts_visibles;

	public PlatformOptions(String name_registry, boolean docked, boolean selected, boolean selected2,
			boolean selected3, HashMap<String, Integer> links_liste, HashMap<String, Integer> mitte_liste,
			HashMap<String, Integer> rechts_liste, HashMap<String, Boolean> links_visibles,
			HashMap<String, Boolean> mitte_visibles, HashMap<String, Boolean> rechts_visibles, boolean temp) {
		this.tempDataOnly = temp;
		this.name_registry = name_registry;
		this.docked = docked;
		this.selectedONE = selected;
		this.selectedTWO = selected2;
		this.selectedTHREE = selected3;
		this.mode = selectedONE ? 1 : selectedTWO ? 2 : 3;
		this.links_liste = links_liste;
		this.mitte_liste = mitte_liste;
		this.rechts_liste = rechts_liste;
		this.links_visibles = links_visibles;
		this.mitte_visibles = mitte_visibles;
		this.rechts_visibles = rechts_visibles;
	}

	

	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof PlatformOptions)) {
			return false;
		}
		PlatformOptions other = (PlatformOptions) obj;
		if (docked != other.docked) {
			return false;
		}
		if (links_liste == null) {
			if (other.links_liste != null) {
				return false;
			}
		} else if (!links_liste.equals(other.links_liste)) {
			return false;
		}
		if (links_visibles == null) {
			if (other.links_visibles != null) {
				return false;
			}
		} else if (!links_visibles.equals(other.links_visibles)) {
			return false;
		}
		if (mitte_liste == null) {
			if (other.mitte_liste != null) {
				return false;
			}
		} else if (!mitte_liste.equals(other.mitte_liste)) {
			return false;
		}
		if (mitte_visibles == null) {
			if (other.mitte_visibles != null) {
				return false;
			}
		} else if (!mitte_visibles.equals(other.mitte_visibles)) {
			return false;
		}
		if (mode != other.mode) {
			return false;
		}
		if (name_registry == null) {
			if (other.name_registry != null) {
				return false;
			}
		} else if (!name_registry.equals(other.name_registry)) {
			return false;
		}
		if (rechts_liste == null) {
			if (other.rechts_liste != null) {
				return false;
			}
		} else if (!rechts_liste.equals(other.rechts_liste)) {
			return false;
		}
		if (rechts_visibles == null) {
			if (other.rechts_visibles != null) {
				return false;
			}
		} else if (!rechts_visibles.equals(other.rechts_visibles)) {
			return false;
		}
		if (selectedONE != other.selectedONE) {
			return false;
		}
		if (selectedTHREE != other.selectedTHREE) {
			return false;
		}
		if (selectedTWO != other.selectedTWO) {
			return false;
		}
		if (tempDataOnly != other.tempDataOnly) {
			return false;
		}
		return true;
	}



	public boolean isMode(int i) {
		return mode == i;
	}

	public int getMode() {
		return mode;
	}

	public boolean hasInitData() {
		return !tempDataOnly;
	}

	public HashMap<String, Integer> getLeftList() {
		return this.links_liste;
	}

	public HashMap<String, Integer> getMiddleList() {
		return this.mitte_liste;
	}

	public HashMap<String, Integer> getRightList() {
		return this.rechts_liste;
	}

	protected boolean isPlatformVisible(String platform_name) {
		return this.links_visibles.containsKey(platform_name) ? links_visibles.get(platform_name) : this.mitte_visibles
				.containsKey(platform_name) ? mitte_visibles.get(platform_name) : this.rechts_visibles
				.containsKey(platform_name) ? rechts_visibles.get(platform_name) : true;
	}

}
